﻿//组合的圆和扇形类扩展类库
//author 夏天的树人
//vesion 1.0
package org.summerTree.graphics
{
	import flash.display.Sprite;

	public class SectorEx extends Sector
	{
       
	    private var radius:Number;
		private var Bottom_circle:Circle;
		private var fillcolor:uint;
		private var mysector:Sector;
		public function SectorEx(radius:Number=0,fillcolor:uint=0xffffff)
		{
			this.radius=radius;
			this.fillcolor=fillcolor;
			Bottom_circle=new Circle();		
			addChild(Bottom_circle);
			Bottom_circle.CreatCircle(radius,fillcolor);
			
			mysector=new Sector();
		    addChild(sector);
		}
		
		
		//克隆对象
		override public function clone():*
		{
			return new SectorEx(radius,fillcolor);
		}
		
		
		/*startAngle 开始角度
		 *endAngle 结束角度
		 *fillcolor 填充颜色
		 *alpha 透明度
		*/
		public function CreatSectorEx(startAngle:Number,endAngle:Number,fillcolor:uint=0xffffff,alpha:Number=1):void
		{	
			mysector.CreatSector(radius,startAngle,endAngle,fillcolor,alpha);
		}
		
		/* 获取底部圆
		 */
		public function get circle():Circle
		{
			return this.Bottom_circle;
		}
		
		/* 获取扇形对象
		 */
		public function get sector():Sector
		{
			return this.mysector;
		}
		
		//删除
		override public function clear():void
		{
			sector.clear();
			Bottom_circle.clear();		
		}
		
	}
}